package com.atguigu.userprofile.dao

import com.atguigu.userprofile.bean.TagInfo
import com.atguigu.userprofile.util.MySqlUtil

object TagInfoDao {
  def getTagInfoByTaskID(taskId:String) : TagInfo ={
    val sql = s"select * from tag_info where tag_task_id=$taskId"
    var tagInfo : TagInfo =null;
    val maybeInfo: Option[TagInfo] = MySqlUtil.queryOne(sql,classOf[TagInfo],true)
    if(maybeInfo == None){
      throw new RuntimeException(s"no tag for task_id:$taskId")
    }else{
      tagInfo= maybeInfo.get
    }
    tagInfo
  }

}
